/*
 * CompoundStatement.cpp
 *
 *  Created on: 05/05/2010
 *      Author: rodolfo
 */

#include "CompoundStatement.h"

CompoundStatement::CompoundStatement() :
        Statement ( compoundStm )
{

}

CompoundStatement::CompoundStatement ( Declarations *declarationList ) :
        declarationList ( declarationList ), Statement ( compoundStm )
{
}

CompoundStatement::CompoundStatement ( Declarations *declaretionList, Statements *statementList ) :
        declarationList ( declaretionList ), statementList ( statementList ), Statement ( compoundStm )
{
}

CompoundStatement::CompoundStatement ( Statements *statementList ) :
        statementList ( statementList ), Statement ( compoundStm )
{
}

CompoundStatement::~CompoundStatement() {
	if( declarationList != 0 ){
			Declarations::iterator it = declarationList->begin();
		while ( it != declarationList->end() ){
			delete *it;
		}
		declarationList->clear();
	}
	if( statementList != 0 ){
		Statements::iterator it = statementList->begin();
		while ( it != statementList->end() ){
			delete *it;
		}
		statementList->clear();
	}
}
